﻿<Window x:Class="CoreCloud.HostWPF.MainWindow"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		Title="MainWindow" Height="350" Width="525"
		xmlns:config="clr-namespace:CoreCloud.HostWPF.Properties" Closing="Window_Closing" Loaded="Window_Loaded">
	<Window.Resources>
		<SolidColorBrush x:Key="errorBrush" Color="LightGray" x:Name="errorBrush" />
	</Window.Resources>
	
	<Grid>
		<TabControl>
			<TabItem Header="Status">
				<ScrollViewer VerticalScrollBarVisibility="Auto">
					<StackPanel Name="parallelEngineControl">
						<StackPanel>
							<CheckBox Content="Parallel Engine" Name="enableParallelEngine" Checked="enableParallelEngine_Checked" />
						</StackPanel>
					</StackPanel>
				</ScrollViewer>
			</TabItem>
			
			<TabItem Header="Performance">
			</TabItem>
			
			<TabItem Header="Permissions"></TabItem>
			
			<TabItem Header="Settings">
				<ScrollViewer VerticalScrollBarVisibility="Auto">
					<StackPanel>
						<GroupBox Padding="2">
							<GroupBox.Header>
								<CheckBox x:Name="useCredentials" Content="Run under different credentials"
										  IsChecked="{Binding Source={x:Static config:Settings.Default}, Path=UseCredentials, Mode=TwoWay}"/>
							</GroupBox.Header>
						
							<Grid IsEnabled="{Binding ElementName=useCredentials, Path=IsChecked}">
								<Grid.RowDefinitions>
									<RowDefinition/>
									<RowDefinition/>
								</Grid.RowDefinitions>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto"/>
									<ColumnDefinition />
									<ColumnDefinition Width="Auto"/>
								</Grid.ColumnDefinitions>
							
								<TextBlock Grid.Column="0" Grid.Row="0" Margin="2" 
										   Text="Login" />
								<TextBox Grid.Column="1" Grid.Row="0" Margin="2" Name="login" TextChanged="login_TextChanged" Background="{StaticResource errorBrush}"
										 Text="{Binding Source={x:Static config:Settings.Default}, Path=Login, Mode=TwoWay}"/>
								<Button Grid.Column="2" Grid.Row="0" Padding="2"
										Content="Create" ToolTip="Create a new user using these credentials" Name="createUser" />
							
								<TextBlock Grid.Column="0" Grid.Row="1" Text="Password" Margin="2" />
								<PasswordBox Grid.Column="1" Grid.Row="1" Margin="2" Name="password" PasswordChanged="password_PasswordChanged" Background="{StaticResource errorBrush}" LostFocus="password_LostFocus" />
							</Grid>
						</GroupBox>
					</StackPanel>
				</ScrollViewer>
			</TabItem>
		</TabControl>
	</Grid>
</Window>
